SOURCES = $(wildcard *.cpp)
OBJECTS = $(SOURCES:.cpp=.o)
CXXFLAGS = -W -Wall -g
CXX = g++
MAIN = client

clientbuild: $(MAIN)

clean:
	rm -f *.o *.d $(MAIN)

$(MAIN): $(OBJECTS)
	$(CXX) -o $@ $(OBJECTS)

%.o: %.cc
	$(CXX) -o  $@ -c $(CXXFLAGS) $<

%.d: %.cc
	set -e; $(CC) -M $< \
                  | sed 's/\($*\)\.o[ :]*/\1.o $@ : /g' > $@; \
                [ -s $@ ] || rm -f $@

